from pdfminer.layout import LTTextContainer
from pdfminer import high_level

# text = high_level.extract_text('解释器.pdf')
#print(text)

pages = high_level.extract_pages('python介绍.pdf')
pages_list = list(pages) #generator

print(len(pages_list))
for page in pages_list[2:4]:
    for element in page:
        if isinstance(element, LTTextContainer):
            print(element.get_text())
